/*
 * Copyright 2020-2021 the original author or authors.
 *
 * Licensed under the General Public License, Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.gnu.org/licenses/gpl-3.0.en.html
 */

package team.seekers.oj.lesson.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import team.seekers.oj.common.entity.BaseDO;

import java.util.Date;


@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(ChapterDOField.TABLE_NAME)
public class ChapterDO extends BaseDO {

    @TableId(value = ChapterDOField.ID, type = IdType.AUTO)
    private Long chapterId;

    @TableField(value = ChapterDOField.GMT_CREATE, fill = FieldFill.INSERT)
    private Date gmtCreate;

    @TableField(value = ChapterDOField.GMT_MODIFIED, fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @TableField(ChapterDOField.DELETED)
    @TableLogic(value = "0", delval = "1")
    private Integer deleted;

    @TableField(ChapterDOField.VERSION)
    @Version
    private Integer version;

    @TableField(ChapterDOField.NAME)
    private String chapterName;

    @TableField(ChapterDOField.COURSE_ID)
    private Long courseId;

    @TableField(ChapterDOField.SECTIONS)
    private byte[] sections;
}